package com;

import com.pojo.CCc;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 123456
 * @description 针对表【c_cc】的数据库操作Mapper
 * @createDate 2024-11-18 10:18:14
 * @Entity com.pojo.CCc
 */
public interface CCcMapper {

    int deleteByPrimaryKey(Long id);

    int insert(CCc record);

    int insertSelective(CCc record);

    CCc selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CCc record);

    int updateByPrimaryKey(CCc record);

    //    @Select("SELECT * FROM c_cc WHERE id = #{id}")
//    @Results({@Result(id = true,column = "id",property = "id"),
//      @Result(column = "classname",property = "classname")
//    })
//    List<CCc> selectCCcById(int id);
    @Select("select * from c_class where id = #{id}")
    @Results({@Result(id = true, column = "id", property = "id"),
            @Result(column = "classname", property = "classname"),
            @Result(column = "id", property = "students",many = @Many(select = "com.mapper.SStudentMapper.selectCCcById"))
    })
    CCc selectByCid(int cid);
}
